﻿<?php TPL::output('admin/global/header.tpl.htm'); ?>

<script src="<?php echo G_STATIC_URL; ?>/js/ajaxupload.js" type="text/javascript"></script>

<body >

<div id="body-wrapper">
	<div id="main-content">
		<div class="clear"></div>
		<div class="content-box">
			<div class="content-box-header">
				<h3>话题管理</h3>
				<ul class="content-box-tabs">
				</ul>
				<div class="clear"></div>
			</div>
			<div class="content-box-content">
				<div class="tab-content default-tab" id="tab1">
					<form id="_search_form" action="admin/topic/list/" method="post">
						<p>
							<label>根据话题关键词搜索：&nbsp;&nbsp;
							<input class="text-input small-input" type="text" id="keyword" name="keyword" value="<?php echo $this->keyword; ?>"/>&nbsp;&nbsp;
							<input class="button" type="submit" value="搜  索" />
							<?php if($this->keyword){ ?>
							&nbsp;&nbsp;&nbsp;&nbsp;
							<input class="button" type="submit" onClick="$('#keyword').val('');$('#_search_form').submit();" value="显示全部" />
							<?php } ?>
							</label>
						</p>
					</form>
					
					<?php if(!$this->list){ ?>
					<div class="notification attention png_bg"> <a href="#" class="close"><img src="<?php echo G_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
						<div>
						<?php if($this->keyword){ ?> 搜索不到与&nbsp;<?php echo $this->keyword; ?>&nbsp;相关的内容， 返回<a href="javascript:;" onClick="$('#keyword').val('');$('#_search_form').submit();">显示全部</a>
						<?php }else{ ?>
							没有话题
						<?php } ?>
						</div>
					</div>
					<?php }else{ ?>
					
					<table>
						<thead>
							<tr>
								<th style="width:40px;">ID</th>
								<th style="width:50px;">缩略图</th>
								<th>话题标题</th>
								<th>状态</th>
								<th>操作</th>
							</tr>
						</thead>
						<tfoot>
							<tr>
								<td colspan="6">
									<div class="pagination">
										<?php echo $this->pagination; ?>
									</div>
									<div class="clear"></div>
									</td>
							</tr>
						</tfoot>
						<tbody>
<?php foreach ($this->list AS $key => $val) { ?>
							<tr>
								<td><?php echo $val['topic_id']; ?></td>
								<td><div align="center"><a href="topic/<?php echo $val['topic_id']; ?>" target="_blank"><img src="<?php echo $val['topic_pic']."?rd=".rand(100000,999999); ?>" align="middle" /></a></div></td>
								<td><a href="topic/<?php echo $val['topic_id']; ?>" target="_blank"><?php echo $val['topic_title']; ?></a></td>
								<td>
								<?php if($val['topic_lock'] == 1){ ?>
									<a href="javascript:;" onClick="topic_lock(<?php echo $val['topic_id']; ?>, 0)" title="解除锁定"><img src="<?php echo G_STATIC_URL;?>/admin/images/icons/lock.png"/></a>
								<?php }else{ ?>
									<a href="javascript:;" onClick="topic_lock(<?php echo $val['topic_id']; ?>, 1)" title="锁定话题"><img src="<?php echo G_STATIC_URL;?>/admin/images/icons/unlock.png"/></a>
								<?php } ?>
								</td>
								<td>
									<a href="admin/topic/edit/topic_id-<?php echo $val['topic_id']; ?>" title="修改话题"><img src="<?php echo G_STATIC_URL;?>/admin/images/icons/pencil.png"/></a>
									&nbsp;
									<a href="javascript:void(0);" onClick="topic_remove(<?php echo $val['topic_id'];?>)" name="remove" rel="<?php echo $val['topic_id']; ?>" title="删除话题"><img src="<?php echo G_STATIC_URL;?>/admin/images/icons/cross.png" alt="删除" /></a>								</td>
							</tr>
<?php } ?>
						</tbody>
					</table>
					<?php } ?>
				</div>
		</div>
		
		<div class="clear"></div>
		<div id="notf_tip" style="display:none;" class="notification png_bg"> <a href="javascript:;" class="close"><img src="<?php echo G_STATIC_URL;?>/admin/images/icons/cross_grey_small.png" alt="关闭" /></a>
			<div id="notf_cont"></div>
		</div>
		
	</div>
</div>

<?php TPL::output('admin/global/footer.tpl.htm'); ?>